const TokenKey = 'Admin-Token'

export function getToken() {
    return sessionStorage.getItem(TokenKey)
}

export function setToken(token) {
    return sessionStorage.setItem(TokenKey, token)
}

export function removeToken() {
    return sessionStorage.removeItem(TokenKey)
}
export function searchStartAndEnd(params, timeObj={},createTime='createTime') {
    if (JSON.stringify(timeObj.value)=="{}" || timeObj.value==undefined) return params
    let obj = {};
    let time = params[createTime]
    obj[timeObj["start"]] = time == null ? '' : time[0],//开始时间
      obj[timeObj["end"]] = time == null ? '' : time[1] + ' 23:59' //结束时间
    return {...params,...obj}
}